package com.bagus.mediapipefacedetection.manager;


import com.bagus.mediapipefacedetection.ctrl.FaceDetectCtrl;
import com.bagus.mediapipefacedetection.quality.DetectQualityInfo;
import com.google.mediapipe.formats.proto.LandmarkProto;

import java.util.List;

public class FaceDetectManager {
    private FaceDetectCtrl faceDetectCtrl;

    private FaceDetectManager() {
        faceDetectCtrl = new FaceDetectCtrl();
    }

    private static final class Holder {
        private static final FaceDetectManager INSTANCE = new FaceDetectManager();
    }

    public static FaceDetectManager getInstance() {
        return Holder.INSTANCE;
    }

//    public boolean init(byte[] trackModel, byte[] mouthModel, byte[] eyeModel, byte[] poseModel, byte[] blurModel) {
//        return faceDetectCtrl.init(trackModel, mouthModel, eyeModel, poseModel, blurModel);
//    }
//
//    public void release() {
//        faceDetectCtrl.release();
//    }
//
//    public void startDetect() {
//        faceDetectCtrl.detect();
//    }
//
    public void stopDetect() {
        faceDetectCtrl.stopDetect();
    }
//
//    public void reset() {
//        faceDetectCtrl.reset();
//    }
//
    public DetectQualityInfo detect(int imageMode, List<LandmarkProto.NormalizedLandmark> landmarks, int width, int height) {
        return faceDetectCtrl.detect(imageMode, landmarks, width, height);
    }
//
//    public int getDetectStatus() {
//        return faceDetectCtrl.getDetectStatus();
//    }
//
//    public void setConfig(float face_max_offset_scale,float face_eye_occlusion,
//                                             float face_mouth_occlusion,float face_yaw,float face_pitch,float face_max_brightness,
//                                             float face_min_brightness,float face_min_size_ratio,float face_max_size_ratio,float face_motion_blur,
//                                             float face_gaussian_blur,float face_center_rectX,float face_center_rectY,int need_holding) {
//        faceDetectCtrl.setConfig(face_max_offset_scale, face_eye_occlusion,
//                face_mouth_occlusion, face_yaw, face_pitch, face_max_brightness,
//                face_min_brightness, face_min_size_ratio, face_max_size_ratio,face_motion_blur,
//                face_gaussian_blur, face_center_rectX, face_center_rectY, need_holding);
//    }
}
